#ifndef FILEHANDLER_H
#define FILEHANDLER_H

#include <QProcess>
#include <filesystem>
#include <QDebug>
#include <QFile>
#include <QJsonDocument>
#include <QJsonParseError>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QRegularExpression>
#include <QMap>


class FileHandler: public QObject
{
    Q_OBJECT
public:
    explicit FileHandler(const QString& file, QObject* obj);
    void loadFile(const QString& fn);
    QMap<QString, QString> loadJson();
    void saveFile(const QMap<QString, QString>&);
signals:
    void json_generated(bool);
private:
    QFile* file;
    QJsonDocument document;
    QString filepath;
    QString json_file;
    QObject* object;
    QString nameid;
    QProcess* process;
};

#endif // FILEHANDLER_H
